#!/usr/bin/env python
# encoding: utf-8
'''
python 读写文件
'''
import re
from Snowflake import IDWorker

def redFile():
    file = open("dic_biz.sql", 'r', encoding='utf-8')
    file_end = open('dic_biz_end.sql', 'w',encoding='utf-8')
    worker = IDWorker(1, 1, 0)
    while True:
        line = file.readline()
        if not line:
            break
        file_end.write(line.replace(''.join(re.findall("\\(\d+\\,", line)),'(' + (str(worker.get_ID())) + (",")))

if __name__ == '__main__':
    redFile()